<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<table>
	
	<tr>
		<td colspan="1">
			<select name="month">
				<option ${(not empty user) && (0 eq user.dateOfBirth.month) ? 'selected=selected' : ''} value="1">January</option>
				<option ${(not empty user) && (1 eq user.dateOfBirth.month) ? 'selected=selected' : ''} value="2">February</option>
				<option ${(not empty user) && (2 eq user.dateOfBirth.month) ? 'selected=selected' : ''} value="3">March</option>
				<option ${(not empty user) && (3 eq user.dateOfBirth.month) ? 'selected=selected' : ''} value="4">April</option>
				<option ${(not empty user) && (4 eq user.dateOfBirth.month) ? 'selected=selected' : ''} value="5">May</option>
				<option ${(not empty user) && (5 eq user.dateOfBirth.month) ? 'selected=selected' : ''} value="6">June</option>
				<option ${(not empty user) && (6 eq user.dateOfBirth.month) ? 'selected=selected' : ''} value="7">July</option>
				<option ${(not empty user) && (7 eq user.dateOfBirth.month) ? 'selected=selected' : ''} value="8">August</option>
				<option ${(not empty user) && (8 eq user.dateOfBirth.month) ? 'selected=selected' : ''} value="9">September</option>
				<option ${(not empty user) && (9 eq user.dateOfBirth.month) ? 'selected=selected' : ''} value="10">October</option>
				<option ${(not empty user) && (10 eq user.dateOfBirth.month) ? 'selected=selected' : ''} value="11">November</option>
				<option ${(not empty user) && (11 eq user.dateOfBirth.month) ? 'selected=selected' : ''} value="12">December</option>
			</select>
		</td>
		<td>
			<select name="day">
				<c:forEach var="i" begin="1" end="31">
					<c:choose>
		    			<c:when test="${ empty user }">
							<option value="${i}">${i}</option>
		    			</c:when>
		    			<c:otherwise>
		    			  	<c:choose>
								<c:when test="${i eq user.dayOfBirth}">
									<option selected="selected" value="${i}">${i}</option>
								</c:when>
								<c:otherwise>
									<option value="${i}">${i}</option>
								</c:otherwise>
							</c:choose>
		    			</c:otherwise>
		    		</c:choose>
				</c:forEach>
			</select>	
		</td>
		<td>
			<select name="year">
				<c:forEach var="i" begin="1930" end="2000">
					<c:choose>
		    			<c:when test="${ empty user }">
							<option value="${3930-i}">${3930-i}</option>
		    			</c:when>
		    			<c:otherwise>
		    			  	<c:choose>
								<c:when test="${i eq user.yearOfBirth}">
										<option selected="selected" value="${i}">${i}</option>
								</c:when>
								<c:otherwise>
									<option value="${3930-i}">${3930-i}</option>
								</c:otherwise>
							</c:choose>
		    			</c:otherwise>
		    		</c:choose>
				</c:forEach>
			</select>	
		</td>	
	</tr>
</table>